﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string name = textBox1.Text;
            string mima = textBox2.Text;

            //非空验证
            if (name == "" || mima == "") 
            {
                MessageBox.Show("请输入用户名、密码");
            }

            //查询
            string sql = string.Format("select * from admin1 where Name");
            SqlDataReader dr = DBHelper.Select(sql);
            if () 
            {

            }


            //注册 添加数据
            string sql1 = string.Format("insert into admin1(Name, Password)select '{0}','{1}'", name, mima);

            bool result = DBHelper.Ha(sql1);
        }
    }
}
